-- CALC_BIG_DIVISION

-- 计算 a * b / c  其中a * b 可能超出32bit
return function(a, b, c)
    if a < 0 then
        return -FormulaM.invoke("CALC_BIG_DIVISION", -a, b, c);
    end

    if b < 0 then
        return -FormulaM.invoke("CALC_BIG_DIVISION", a, -b, c);
    end

    -- 如果本身比较小就不用展开了
    if a == 0 or b == 0 or a < math.floor(MAX_VALUE / b) then
        return math.floor(a * b / c);
    end

    local wa = math.floor(a / c);
    local ra = a % c;
    local wb = math.floor(b / c);
    local rb = b % c;

    return wa * wb * c + wa * rb + wb * ra + math.floor(ra * rb / c);
end
